package com.zmj.sy.mom.srv.aps.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmj.sy.mom.srv.aps.bean.entity.nest.NestPushDraw;
import com.zmj.sy.mom.srv.aps.bean.vo.order.OrderPushStatusResVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.ss.formula.functions.T;

@Mapper
public interface NestPushDrawMapper extends SyMapper<NestPushDraw> {

    @Select("SELECT o.serial_code AS orderCode, o.construct_no AS constructCode, d.part_id AS partCode, d.part_name AS partName, p.plan_amount AS quantity, d.create_date_time AS pushTime, d.`status` AS `status`, d.error_msg AS remark, p.plan_id AS nestPlanId FROM tb_nest_push_draw d LEFT JOIN tb_order o ON d.order_id=o.id LEFT JOIN tb_nest_push_plan p ON d.uni_mater_code=p.uni_mater_code WHERE d.order_id=#{orderId} ORDER BY d.`status` DESC")
    Page<OrderPushStatusResVo> pushStatusSelect(Page<T> page, @Param("orderId") Integer orderId);

}
